<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>相对定位</title>
		<style>
			.div1,
			.div2 {
				width: 200px;
				height: 200px;
			}
			
			.div1 {
				background-color: teal;
				position: relative;
				top: 100px;
				left: 100px;
			}
			
			.div2 {
				background-color: indianred;
				position: relative;
				top: 100px;
				left: 100px;
			}
		</style>
	</head>

	<body>
		<div class="div1"></div>
		<div class="div2"></div>
	</body>

</html>